{extend name="common/base" /}
<!--title-->
{block name="titlekeyword"}
<title>{$content}</title>

{/block}
<!--下面是 头部的js-->
{block name="headjs"}
<script language="javascript">

		function Person(name, age) {
			//用传入的参数，来初始化属性
			this.name = name;
			this.age = age;
			//函数名是show this代表公开
			this.show = function () {
				document.write("名字=" + this.name)

				this.jisuan = function () {
					var res = 0;
					for (var i = 1; i <= 1000; i++) {
						res += i;
					} return res;
				}
			}
		}
		var p1 = new Person("宋江1", 90);  //实例化类的方法二 传参
		p1.show();
		var p2 = new Person("林冲", 18);
		p2.show();
		
		document.write("<br/>res=" + p1.jisuan());


	
</script> {/block}
<!--代码主要内容-->
{block name="main"}
<h6>内容</h6>

<h6>代码</h6>
<pre>
		&lt;script language="javascript"&gt;
	
			function Person(name, age) {
				//用传入的参数，来初始化属性
				this.name = name;
				this.age = age;
				//函数名是show this代表公开
				this.show = function () {
					document.write("名字=" + this.name)
	
					this.jisuan = function () {
						var res = 0;
						for (var i = 1; i &lt;= 1000; i++) {
							res += i;
						} return res;
					}
				}
			}
			var p1 = new Person("宋江", 90);  //实例化类的方法二 传参
			p1.show();
			var p2 = new Person("林冲", 18);
			p2.show();
			document.write("&lt;br/&gt;res=" + p1.jisuan());
	
	
		
	&lt;/script&gt;

	 </pre> {/block}
<!--底部js 在这里是js的实际代码区-->
